package cn.tedu.spring.eg2;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Product {
    @Value("苹果")
    private String title;
    @Value("20")
    private Integer num;
    private String commit;
    @Value("1")
    private int apple;
    @Value("好吃")
    public void setCommit(String commit) {
        this.commit = commit;
    }

    @Override
    public String toString() {
        return "Product{" +
                "title='" + title + '\'' +
                ", num=" + num +
                ", commit='" + commit + '\'' +
                ", apple=" + apple +
                '}';
    }
}
